<script setup>
import { ref } from 'vue'
import Son from './components/Son.vue'

const money = ref(14000)

// 子组件传递消费金额，父组件修改 money 值
const changeMoneyFn = val => {
  money.value -= val
}
</script>

<template>
  <h1>👨父组件 {{ money }}</h1>
  <!-- 子组件触发父组件的自定义事件 -->
  <Son :money="money" @changeMoney="changeMoneyFn" />
</template>
